
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/11/6 14:00:18
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'Fin_UploadLog' table
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(FinUploadLog))]	
	[XmlType("FinUploadLog")]
	public partial class FinUploadLog : esFinUploadLog
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new FinUploadLog();
		}
		
		#region Static Quick Access Methods
		static public void Delete(System.Decimal sapUploadId)
		{
			var obj = new FinUploadLog();
			obj.SapUploadId = sapUploadId;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save();
		}

	    static public void Delete(System.Decimal sapUploadId, esSqlAccessType sqlAccessType)
		{
			var obj = new FinUploadLog();
			obj.SapUploadId = sapUploadId;
			obj.AcceptChanges();
			obj.MarkAsDeleted();
			obj.Save(sqlAccessType);
		}
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("FinUploadLogCollection")]
	public partial class FinUploadLogCollection : esFinUploadLogCollection, IEnumerable<FinUploadLog>
	{
		public FinUploadLog FindByPrimaryKey(System.Decimal sapUploadId)
		{
			return this.SingleOrDefault(e => e.SapUploadId == sapUploadId);
		}

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(FinUploadLog))]
		public class FinUploadLogCollectionWCFPacket : esCollectionWCFPacket<FinUploadLogCollection>
		{
			public static implicit operator FinUploadLogCollection(FinUploadLogCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator FinUploadLogCollectionWCFPacket(FinUploadLogCollection collection)
			{
				return new FinUploadLogCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class FinUploadLogQuery : esFinUploadLogQuery
	{
        public FinUploadLogQuery()
            : this("FinUploadLogQuery")
		{
		}
		public FinUploadLogQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "FinUploadLogQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(FinUploadLogQuery query)
		{
			return FinUploadLogQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator FinUploadLogQuery(string query)
		{
			return (FinUploadLogQuery)FinUploadLogQuery.SerializeHelper.FromXml(query, typeof(FinUploadLogQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esFinUploadLog : esEntity
	{
		public esFinUploadLog()
		{

		}
		
		#region LoadByPrimaryKey
		public virtual bool LoadByPrimaryKey(System.Decimal sapUploadId)
		{
			if(this.es.Connection.SqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(sapUploadId);
			else
				return LoadByPrimaryKeyStoredProcedure(sapUploadId);
		}

		public virtual bool LoadByPrimaryKey(esSqlAccessType sqlAccessType, System.Decimal sapUploadId)
		{
			if (sqlAccessType == esSqlAccessType.DynamicSQL)
				return LoadByPrimaryKeyDynamic(sapUploadId);
			else
				return LoadByPrimaryKeyStoredProcedure(sapUploadId);
		}

		private bool LoadByPrimaryKeyDynamic(System.Decimal sapUploadId)
		{
			FinUploadLogQuery query = new FinUploadLogQuery();
			query.Where(query.SapUploadId == sapUploadId);
			return this.Load(query);
		}

		private bool LoadByPrimaryKeyStoredProcedure(System.Decimal sapUploadId)
		{
			esParameters parms = new esParameters();
			parms.Add("SapUploadId", sapUploadId);
			return this.Load(esQueryType.StoredProcedure, this.es.spLoadByPrimaryKey, parms);
		}
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to Fin_UploadLog.SapUploadId
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? SapUploadId
		{
			get
			{
				return base.GetSystemDecimal(FinUploadLogMetadata.ColumnNames.SapUploadId);
			}
			
			set
			{
				if(base.SetSystemDecimal(FinUploadLogMetadata.ColumnNames.SapUploadId, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.SapUploadId);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.ExcelName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String ExcelName
		{
			get
			{
				return base.GetSystemString(FinUploadLogMetadata.ColumnNames.ExcelName);
			}
			
			set
			{
				if(base.SetSystemString(FinUploadLogMetadata.ColumnNames.ExcelName, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.ExcelName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.FileName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String FileName
		{
			get
			{
				return base.GetSystemString(FinUploadLogMetadata.ColumnNames.FileName);
			}
			
			set
			{
				if(base.SetSystemString(FinUploadLogMetadata.ColumnNames.FileName, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.FileName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.AllCount
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? AllCount
		{
			get
			{
				return base.GetSystemInt32(FinUploadLogMetadata.ColumnNames.AllCount);
			}
			
			set
			{
				if(base.SetSystemInt32(FinUploadLogMetadata.ColumnNames.AllCount, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.AllCount);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.NowCount
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? NowCount
		{
			get
			{
				return base.GetSystemInt32(FinUploadLogMetadata.ColumnNames.NowCount);
			}
			
			set
			{
				if(base.SetSystemInt32(FinUploadLogMetadata.ColumnNames.NowCount, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.NowCount);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.CreatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CreatedBy
		{
			get
			{
				return base.GetSystemString(FinUploadLogMetadata.ColumnNames.CreatedBy);
			}
			
			set
			{
				if(base.SetSystemString(FinUploadLogMetadata.ColumnNames.CreatedBy, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.CreatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.CreateDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CreateDttm
		{
			get
			{
				return base.GetSystemDateTime(FinUploadLogMetadata.ColumnNames.CreateDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(FinUploadLogMetadata.ColumnNames.CreateDttm, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.CreateDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.IsDeleted
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsDeleted
		{
			get
			{
				return base.GetSystemBoolean(FinUploadLogMetadata.ColumnNames.IsDeleted);
			}
			
			set
			{
				if(base.SetSystemBoolean(FinUploadLogMetadata.ColumnNames.IsDeleted, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.IsDeleted);
				}
			}
		}		
		
		/// <summary>
		/// Maps to Fin_UploadLog.DeleteReason
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DeleteReason
		{
			get
			{
				return base.GetSystemString(FinUploadLogMetadata.ColumnNames.DeleteReason);
			}
			
			set
			{
				if(base.SetSystemString(FinUploadLogMetadata.ColumnNames.DeleteReason, value))
				{
					OnPropertyChanged(FinUploadLogMetadata.PropertyNames.DeleteReason);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "SapUploadId": this.str().SapUploadId = (string)value; break;							
						case "ExcelName": this.str().ExcelName = (string)value; break;							
						case "FileName": this.str().FileName = (string)value; break;							
						case "AllCount": this.str().AllCount = (string)value; break;							
						case "NowCount": this.str().NowCount = (string)value; break;							
						case "CreatedBy": this.str().CreatedBy = (string)value; break;							
						case "CreateDttm": this.str().CreateDttm = (string)value; break;							
						case "IsDeleted": this.str().IsDeleted = (string)value; break;							
						case "DeleteReason": this.str().DeleteReason = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "SapUploadId":
						
							if (value == null || value is System.Decimal)
								this.SapUploadId = (System.Decimal?)value;
								OnPropertyChanged(FinUploadLogMetadata.PropertyNames.SapUploadId);
							break;
						
						case "AllCount":
						
							if (value == null || value is System.Int32)
								this.AllCount = (System.Int32?)value;
								OnPropertyChanged(FinUploadLogMetadata.PropertyNames.AllCount);
							break;
						
						case "NowCount":
						
							if (value == null || value is System.Int32)
								this.NowCount = (System.Int32?)value;
								OnPropertyChanged(FinUploadLogMetadata.PropertyNames.NowCount);
							break;
						
						case "CreateDttm":
						
							if (value == null || value is System.DateTime)
								this.CreateDttm = (System.DateTime?)value;
								OnPropertyChanged(FinUploadLogMetadata.PropertyNames.CreateDttm);
							break;
						
						case "IsDeleted":
						
							if (value == null || value is System.Boolean)
								this.IsDeleted = (System.Boolean?)value;
								OnPropertyChanged(FinUploadLogMetadata.PropertyNames.IsDeleted);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esFinUploadLog entity)
			{
				this.entity = entity;
			}
			
	
			public System.String SapUploadId
			{
				get
				{
					System.Decimal? data = entity.SapUploadId;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.SapUploadId = null;
					else entity.SapUploadId = Convert.ToDecimal(value);
				}
			}
				
			public System.String ExcelName
			{
				get
				{
					System.String data = entity.ExcelName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ExcelName = null;
					else entity.ExcelName = Convert.ToString(value);
				}
			}
				
			public System.String FileName
			{
				get
				{
					System.String data = entity.FileName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FileName = null;
					else entity.FileName = Convert.ToString(value);
				}
			}
				
			public System.String AllCount
			{
				get
				{
					System.Int32? data = entity.AllCount;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.AllCount = null;
					else entity.AllCount = Convert.ToInt32(value);
				}
			}
				
			public System.String NowCount
			{
				get
				{
					System.Int32? data = entity.NowCount;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.NowCount = null;
					else entity.NowCount = Convert.ToInt32(value);
				}
			}
				
			public System.String CreatedBy
			{
				get
				{
					System.String data = entity.CreatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedBy = null;
					else entity.CreatedBy = Convert.ToString(value);
				}
			}
				
			public System.String CreateDttm
			{
				get
				{
					System.DateTime? data = entity.CreateDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreateDttm = null;
					else entity.CreateDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String IsDeleted
			{
				get
				{
					System.Boolean? data = entity.IsDeleted;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsDeleted = null;
					else entity.IsDeleted = Convert.ToBoolean(value);
				}
			}
				
			public System.String DeleteReason
			{
				get
				{
					System.String data = entity.DeleteReason;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DeleteReason = null;
					else entity.DeleteReason = Convert.ToString(value);
				}
			}
			

			private esFinUploadLog entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return FinUploadLogMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public FinUploadLogQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinUploadLogQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinUploadLogQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(FinUploadLogQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private FinUploadLogQuery query;		
	}



	[Serializable]
	abstract public partial class esFinUploadLogCollection : esEntityCollection<FinUploadLog>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return FinUploadLogMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "FinUploadLogCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public FinUploadLogQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new FinUploadLogQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(FinUploadLogQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new FinUploadLogQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(FinUploadLogQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((FinUploadLogQuery)query);
		}

		#endregion
		
		private FinUploadLogQuery query;
	}



	[Serializable]
	abstract public partial class esFinUploadLogQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return FinUploadLogMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "SapUploadId": return this.SapUploadId;
				case "ExcelName": return this.ExcelName;
				case "FileName": return this.FileName;
				case "AllCount": return this.AllCount;
				case "NowCount": return this.NowCount;
				case "CreatedBy": return this.CreatedBy;
				case "CreateDttm": return this.CreateDttm;
				case "IsDeleted": return this.IsDeleted;
				case "DeleteReason": return this.DeleteReason;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem SapUploadId
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.SapUploadId, esSystemType.Decimal); }
		} 
		
		public esQueryItem ExcelName
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.ExcelName, esSystemType.String); }
		} 
		
		public esQueryItem FileName
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.FileName, esSystemType.String); }
		} 
		
		public esQueryItem AllCount
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.AllCount, esSystemType.Int32); }
		} 
		
		public esQueryItem NowCount
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.NowCount, esSystemType.Int32); }
		} 
		
		public esQueryItem CreatedBy
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.CreatedBy, esSystemType.String); }
		} 
		
		public esQueryItem CreateDttm
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.CreateDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem IsDeleted
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.IsDeleted, esSystemType.Boolean); }
		} 
		
		public esQueryItem DeleteReason
		{
			get { return new esQueryItem(this, FinUploadLogMetadata.ColumnNames.DeleteReason, esSystemType.String); }
		} 
		
		#endregion
		
	}


	
	public partial class FinUploadLog : esFinUploadLog
	{

		
		
	}
	



	[Serializable]
	public partial class FinUploadLogMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected FinUploadLogMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.SapUploadId, 0, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.SapUploadId;
			c.IsInPrimaryKey = true;
			c.IsAutoIncrement = true;
			c.NumericPrecision = 18;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.ExcelName, 1, typeof(System.String), esSystemType.String);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.ExcelName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.FileName, 2, typeof(System.String), esSystemType.String);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.FileName;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.AllCount, 3, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.AllCount;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.NowCount, 4, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.NowCount;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.CreatedBy, 5, typeof(System.String), esSystemType.String);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.CreatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.CreateDttm, 6, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.CreateDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.IsDeleted, 7, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.IsDeleted;
			c.HasDefault = true;
			c.Default = @"((0))";
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(FinUploadLogMetadata.ColumnNames.DeleteReason, 8, typeof(System.String), esSystemType.String);
			c.PropertyName = FinUploadLogMetadata.PropertyNames.DeleteReason;
			c.CharacterMaxLength = 500;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public FinUploadLogMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string SapUploadId = "SapUploadId";
			 public const string ExcelName = "ExcelName";
			 public const string FileName = "FileName";
			 public const string AllCount = "AllCount";
			 public const string NowCount = "NowCount";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreateDttm = "CreateDttm";
			 public const string IsDeleted = "IsDeleted";
			 public const string DeleteReason = "DeleteReason";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string SapUploadId = "SapUploadId";
			 public const string ExcelName = "ExcelName";
			 public const string FileName = "FileName";
			 public const string AllCount = "AllCount";
			 public const string NowCount = "NowCount";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreateDttm = "CreateDttm";
			 public const string IsDeleted = "IsDeleted";
			 public const string DeleteReason = "DeleteReason";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(FinUploadLogMetadata))
			{
				if(FinUploadLogMetadata.mapDelegates == null)
				{
					FinUploadLogMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (FinUploadLogMetadata.meta == null)
				{
					FinUploadLogMetadata.meta = new FinUploadLogMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("SapUploadId", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("ExcelName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("FileName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("AllCount", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("NowCount", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("CreatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreateDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("IsDeleted", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("DeleteReason", new esTypeMap("nvarchar", "System.String"));			
				
				
				
				meta.Source = "Fin_UploadLog";
				meta.Destination = "Fin_UploadLog";
				
				meta.spInsert = "proc_Fin_UploadLogInsert";				
				meta.spUpdate = "proc_Fin_UploadLogUpdate";		
				meta.spDelete = "proc_Fin_UploadLogDelete";
				meta.spLoadAll = "proc_Fin_UploadLogLoadAll";
				meta.spLoadByPrimaryKey = "proc_Fin_UploadLogLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private FinUploadLogMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
